import 'package:flutter/material.dart';

import '../common/app_theme.dart';
import '../common/colors.dart';
import '../pages/daily_work_report_module/my_daily_detail_module/my_daily_detail_controller.dart';
import '../services/address.dart';
import 'package:get/get.dart';
class CommentView extends StatefulWidget {


  MyDailyDetailController controller;
  var index;
  CommentView(this.controller,this.index);
  @override
  State<CommentView> createState() => _CommentViewState();
}

class _CommentViewState extends State<CommentView> {
  @override
  Widget build(BuildContext context) {
    return
      Column(
      children: [
        Container(
          color: Colors.white,
          padding: EdgeInsets.only(left: 15, right: 15,top: 5,bottom: 5),
          // height: 10,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Row(
                children: [
                  CircleAvatar(
                    radius: 15,
                    backgroundImage: NetworkImage(
                        '${Address.homeHost}${widget.controller.commentModel?.data?[widget.index].headerImg}'
                    ),

                  ),
                  SizedBox(
                    width: 5,
                  ),
                  Text(
                    '${widget.controller.commentModel?.data?[widget.index].author}',
                    style: appThemeData.textTheme.subtitle1,
                  ),
                ],
              ),
              Container(
                margin: EdgeInsets.only(top: 5),
                width: Get.width-100,
                child: Text(
                  '${widget.controller.commentModel?.data?[widget.index].comment}',
                  style: appThemeData.textTheme.bodyText1!
                      .copyWith(fontSize: 13),
                ),
              ),
              Container(
                margin: EdgeInsets.only(top: 5),
                child: Text(
                  '${widget.controller.commentModel?.data?[widget.index].dateBeauty}',
                  style: appThemeData.textTheme.subtitle1,
                ),
              ),
            ],
          ),
        ),
        Container(
          height: 10,
          color: AppColor.bgColor,
        )
      ],
    );
  }
}
